package kuba.common;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

public class BeanLogger {

    private static final Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);

    public BeanLogger() {
        LOGGER.setLevel(Level.INFO);
        try {
            SimpleFormatter formatter = new SimpleFormatter();
            FileHandler fileHandler = new FileHandler("log.txt");
            fileHandler.setFormatter(formatter);
            LOGGER.addHandler(fileHandler);
        } catch (SecurityException e) {
            BeanLogger.LOGGER.log(Level.WARNING,e.toString());
        } catch (IOException e) {
            BeanLogger.LOGGER.log(Level.WARNING,e.toString());
        }
    }

    public static Logger getLOGGER() {
        return LOGGER;
    }
    


}
